package com.dg.dao;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

@Repository("dao")
public class DAOImpl implements DAO{

	@Autowired
	private SqlSessionTemplate session;
	
	@Override
	public Object save(String sql, Object params) {
		return session.insert(sql, params);
	}
	
	@Override
	public Object update(String sql, Object params) {
		return session.update(sql, params);
	}
	
	@Override
	public Object delete(String sql, Object params) {
		return session.delete(sql, params);
	}
	
	@Override
	public Object findForList(String sql, Object params) {
		return session.selectList(sql, params);
	}
	
	@Override
	public Object findForOne(String sql, Object params) {
		return session.selectOne(sql, params);
	}
	
}
